<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8"
	import="com.mmp.common.util.*,com.mmp.main.util.*,com.mmp.main.entity.*,java.util.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
	<%
		List<JobOrder> jobOrders = (List<JobOrder>)request.getAttribute("jobOrders");
	%>
	<table id="jo_list" class="tablesorter">
		<thead>
			<tr>
				<th>م</th>
				<th>رقم امر العمل</th>
				<th>تاريخ امر العمل</th>
				<th>تاريخ العطل</th>
				<th>وصف العطل</th>
				<th>اسم الجهاز</th>
				<th>كود الجهاز</th>
				<th>االفئة</th>
				<th>القسم</th>
				<th>الموظف المسؤول</th>
			</tr>
		</thead>
		<tbody>
			<%
				JobOrder jo = null;
				    HospitalDevice hd = null;
				    String qStrFirstPart = Default.SEARCH_DEST_PARAM_NAME +"="+Default.SEARCH_DEST_FOLLOWUP_JOB_OREDR_PARAM_VALUE;
				    String qStr = null;
				    for (int i = 0; i< jobOrders.size(); i++){
				         jo = jobOrders.get(i);
				         hd = jo.getHospitalDevice();
				         qStr = "?" + qStrFirstPart + "&jobOrderNo=" + jo.getJobOrderNo();
			%>
			<tr>
			<td align="center"><%=(i+1)%></td>
				<td><a
					href='<%=request.getContextPath() + "/SearchForJobOrderProcess" + qStr%>'
					target="_blank"> <%=Common.getDisplayString(jo.getJobOrderNo(),"-",true)%></a></td>
					<td><%=DateUtil.getDateString(jo.getJobOrderDate())%></td>
				<td><%=DateUtil.getDateString(jo.getDamageDate())%></td>
				<td><%=Common.getDisplayString(jo.getDamageDescription(),"-",true)%></td>
				<td><%=Common.getDisplayString(hd.getDeviceName(),"-",true)%></td>
				<td><%=Common.getDisplayString(hd.getCode(),"-",true)%></td>
				<td><%=Common.getDisplayString(hd.getLookupDeviceCategory().getName(),"-",true)%></td>
				<td><%=Common.getDisplayString(hd.getHospitalDepatment().getName(),"-",true)%></td>
				<td><%=Common.getDisplayString(jo.getOpenedBy().getName(),"-",true)%></td>
			</tr>
			<%
				}
			%>
		</tbody>
	</table>
	<script>
		$(function() {
			$("#jo_list thead th:eq(1)").data("sorter", false);
			$("#jo_list").tablesorter({
				widthFixed : false,
				widgets : [ 'zebra' ],
				headers: { 0: { sorter: false} }
			});
		});
	</script>
</body>
</html>
